<?php

require_once './lconfig.php';


$reqstr = $_REQUEST['uri'];
$req = explode('/',$reqstr);

// XXX paths should be using GLOBAL NAV or something.
$token = array_shift($req);
switch( $token ) {
  case "handle":
    $runner = './handle.php';
    $page_uri = array_shift($req);
    break;
  case "view":
    $runner = './view.php';
    $page_uri = array_shift($req);
    if( !$page_uri ) 
      $page_uri = 'fora';
    break;
  default:
    $runner = './view.php';
    $page_uri = $token;
    if( !$page_uri ) 
      $page_uri = 'fora';
    break;
}

require_once $runner;
runner($page_uri, $req);

call.$runner($pages, $data);

?>
